package com.cn.por.mq;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
//import org.apache.kafka.clients.consumer.ConsumerRecord;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.kafka.annotation.KafkaListener;
//import org.springframework.kafka.core.KafkaTemplate;
//import org.springframework.kafka.support.Acknowledgment;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController("/web/mq")
@Slf4j
@Api(tags="消息队列kafka")
public class KafkaProducerController {

//    @Autowired
//    private KafkaTemplate<String, String> kafkaTemplate;
//
//    @GetMapping("/send")
//    public String sendMessage(@RequestParam String topic,
//                              @RequestParam String message) {
//        kafkaTemplate.send(topic, message);
//        return "Message sent: " + message;
//    }
//
//    @KafkaListener(topics = "test-topic")
//    public void simpleConsumer(String message) {
//        log.info("Received message: {}", message);
//    }
}